function checkAll() {
	temp = document.form.elements.length;
	for (i=0; i < temp; i++) {
		document.form.elements[i].checked=1;
	}
}

function uncheckAll() {
	temp = document.form.elements.length;
	for (i=0; i < temp; i++) {
		document.form.elements[i].checked=0;
	}
}

function invertAll() {
	temp = document.form.elements.length;
	for (i=0; i < temp; i++) {
		if(document.form.elements[i].checked == 1) {
			document.form.elements[i].checked = 0;
		} else {
			document.form.elements[i].checked = 1
		}
	}
}

function setSpanDescription(spanId, description) {
	document.getElementById(spanId).innerHTML = description
}

function clearAndShowDiv(divId) {
	document.getElementById(divId).innerHTML = "";
	document.getElementById(divId).style.display = "block"
}

function addStudentToDiv(divId, pk, login, email) {
	var oldHTML = document.getElementById(divId).innerHTML;
	document.getElementById(divId).innerHTML = oldHTML + '<li><a href="show_student/' + pk +'">' + login + '</a> (' + email + ')</li>'
}

function surroundItemsWithULTag(divId) {
	var oldHTML = document.getElementById(divId).innerHTML;
	document.getElementById(divId).innerHTML = '<ul>' + oldHTML + '</ul>'
}

function hideDiv(divId) {
	document.getElementById(divId).style.display = "none"
}
